package com.cjkj.system.api;

import com.cjkj.common.core.constant.SecurityConstants;
import com.cjkj.common.core.constant.ServiceNameConstants;
import com.cjkj.common.core.domain.R;
import com.cjkj.system.api.domain.APISmartBraceletData;
import com.cjkj.system.api.domain.SmartBraceletRecords;
import com.cjkj.system.api.domain.request.BraceletHistoryDataReq;
import com.cjkj.system.api.domain.request.LatestDatasReq;
import com.cjkj.system.api.domain.request.PatientEquipmentRTDReq;
import com.cjkj.system.api.domain.request.RecordsReq;
import com.cjkj.system.api.factory.RemoteTJ02DataServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteTJ02DataService",value = ServiceNameConstants.EQUIPMENT_SERVICE, fallbackFactory = RemoteTJ02DataServiceFallbackFactory.class )
public interface RemoteTJ02DataService {

    /**
     * 查询多参数监测仪数据
     * @param req
     * @param source
     * @return
     */
    @PostMapping("/report/tj02Data")
    R<SmartBraceletRecords> listSmartBraceletRecords(@RequestBody RecordsReq req, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    /**
     * 多参数监测仪开单使用期间的最新一条实时数据
     * @param req
     * @param source
     * @return
     */
    @PostMapping("/equipment/getLastBraceletDataInUse")
    R<APISmartBraceletData> getLastBraceletDataInUse(@RequestBody PatientEquipmentRTDReq req,
                                                     @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 获取小程序端 手环历史记录
     * @param req
     * @param source
     * @return
     */
    @PostMapping("/equipment/reqBraceletHistoryData")
    R<Object> reqBraceletHistoryData(@RequestBody BraceletHistoryDataReq req, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 最新一条数据
     * @param req
     * @param source
     * @return
     */
    @PostMapping("/equipment/getLatestDatas")
    R<List<APISmartBraceletData>> getLatestDatas(@RequestBody LatestDatasReq req, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
